package com.company.manage.system.dao;

import com.company.manage.common.persistence.HibernateDao;
import com.company.manage.system.entity.Log;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by HuangYong on 2016/1/22.
 * desc:日志DAO
 */
@Repository
public class LogDao extends HibernateDao<Log,Integer> {
    private static final String TAG = "LogDao";

    /**
     * 批量删除日志
     * @param idList
     */
    public void deleteBatch(List<Integer> idList){
        String hql = "delete from Log l where l.id in (:idList)";
        Query query = getSession().createQuery(hql);
        query.setParameter("idList",idList);
        query.executeUpdate();
    }
} 